package com.android.views;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.navigation.Navigation;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.android.views.databinding.FragmentHomeBinding;

import org.jetbrains.annotations.NotNull;

@SuppressWarnings("all")
public class HomeFragment extends BaseFragment {
    private FragmentHomeBinding binding;

    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    private String mParam1;
    private String mParam2;

    public HomeFragment() {
    }

    public static HomeFragment newInstance(String param1, String param2) {
        HomeFragment fragment = new HomeFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(inflater, R.layout.fragment_home, container, false);
        return binding.getRoot();
    }

    @Override
    public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        binding.setLifecycleOwner(this);

        binding.btRecyclerView.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_homeFragment_to_recyclerViewFragment));
        binding.btRecyclerViewX.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_homeFragment_to_recyclerViewXFragment));
        binding.btDateSelect.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_homeFragment_to_dateSelectFragment));
        binding.btFloatView.setOnClickListener(Navigation.createNavigateOnClickListener(R.id.action_homeFragment_to_floatViewFragment));



        binding.btStartAnim.setOnClickListener(v -> {
        });
        binding.btStartAnimReverse.setOnClickListener(v -> {
        });
        binding.mImageViewAnim.setOnClickListener(v -> {
            /*ObjectAnimator animator=ObjectAnimator.ofFloat(binding.mImageViewAnim,"translationX",0,-200,500);
            animator.start();*/
        });

    }

}